# desktop_app/services/crawler_service.py
from .crawlers import douyin, xiaohongshu

class CrawlerService:
    @staticmethod
    def crawl_by_type(video_type, video_url):
        """根据类型调用不同的爬取方法"""
        if video_type['id'] == 1:  # 假设1是抖音
            return douyin.crawl(video_url)
        elif video_type['id'] == 2:  # 假设2是小红书
            return xiaohongshu.crawl(video_url)
        else:
            raise ValueError(f"不支持的视频类型: {video_type['name']}")